package com.midou.administration.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.midou.administration.bo.MenuAllBo;
import com.midou.administration.bo.CommonResult;
import com.midou.administration.bo.MenuBo;
import com.midou.administration.bo.menuGroupIdBo;
import com.midou.administration.entity.Desk;
import com.midou.administration.entity.DeskType;
import com.midou.administration.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.omg.CORBA.PUBLIC_MEMBER;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
public interface MenuMapper extends BaseMapper<Menu> {

  public List<Menu> findAll(@Param("page") Page page);

  public int updMenu(Menu menu);

  public int istMenu(Menu menu);

  //删除商品
  public int delMenu(int id);

  public Menu findIdMenu(@Param("id") int id);

  public List<MenuBo> queryAll(@Param("page") Page page);
  public MenuBo queryId(@Param("id")Integer id);
  public int queryUp(@Param("tao")MenuBo menuBo);

  List<Menu> queryBybusinessAndDishType(@Param("desk") int desk);

  /**
   * 查询套餐中包含的菜品
   * @return
   */
  List<Menu> queryDishes(menuGroupIdBo mgb);
  Integer addSetMeal(MenuBo mb);

  int addMenu(Menu menu);
  Integer delMenuInSetMeal(Integer mid);
  String findMenuOne(Integer mid);

  int updPopulaTrue(int id);

  int updPopulaFalse(int id);

  int updrecommendTrue(int id);

  int updrecommendFalse(int id);

  int upddiscountTrue(int id);

  int upddiscountFalse(int id);

  int updputontheshelfTrue(int id);

  int updputontheshelfFalse(int id);

  List<Menu> findMenuName(@Param("menuName") String menuName);

  int judgmentMenuName(@Param("menuName") String menuName);
  Integer modifyMenuInSetMeal(MenuBo mb);
  Integer updateShelf(CommonResult cr);
  Integer whetherRecommend(CommonResult cr);
}
